package com.aya.transaction.service;

import com.aya.transaction.mapper.BlogMapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

@Service
public class BlogErrorSqlTransactionService {
    @Resource
    BlogSimpleTransactionService blogSimpleTransactionService;

    @Transactional
    public int updateByIdSuccess(String id, String content, String id2, String content2) throws Exception {
        int i = blogSimpleTransactionService.updateById(id, content);
        blogSimpleTransactionService.updateByIdErrorSql(id2, content2);
        return i;
    }

@Resource
    BlogMapper blogMapper;
    @Transactional
    public void updateByIdSuccessByMapper(String id, String content, String id2, String content2) throws Exception {
        int i = blogMapper.updateById(id, content);
        blogMapper.updateByIdErrorSql(id2, content2);
        throw new Exception("updateByIdSuccessByMapper exp");
    }






}
